def get_tile_col_row(i_map, x, y, level):
    resolution = i_map.Resolutions[level]
    tile_geo_size = i_map.TilePixSize * resolution
    distance_x = x - i_map.OriginX
    distance_y = i_map.OriginY - y

    col = int(distance_x // tile_geo_size)
    row = int(distance_y // tile_geo_size)

    return [col, row]


def code_10_to_ags16(number):
    r = hex(number)[2:]
    r_length = len(r)
    if r_length < 8:
        r = "0" * (8 - r_length) + r
    return r.upper()
